﻿#ifndef CHATWINDOW_H
#define CHATWINDOW_H

#include <QMainWindow>
#include <QListWidget>

class BubbleList;
class QPushButton;
class QPlainTextEdit;


namespace Ui {

class ChatWindow;

}



class ChatWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit ChatWindow(QWidget *parent = nullptr);
    ~ChatWindow();

    void setWindow(const QString& account, bool isUser = true);


    void newChat(int avatar, const QString& text, int messageType, const QString& time = "");

    void newPicture(int avatar, const QString& picPath, const QString& time = "");

    void resizeEvent(QResizeEvent *event) override;


private slots:

    void on_BtnSend_clicked();

    void on_BtnSendPic_clicked();


private:
    QString account;

    BubbleList* bubbleList;
    QPushButton * BtnSend;
    QPlainTextEdit * textEdit;
    QPushButton * BtnSendPic;
    Ui::ChatWindow *ui;
    // if target is a user => true; else if target is a group => false
    bool UserChatWindow;
};

#endif // CHATWINDOW_H
